{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"test data\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(import '[com.twosigma.beakerx.easyform EasyForm])\n",
    "(doto (EasyForm. \"form0\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f1 (doto (EasyForm. \"form1\")\n",
    "        (.addTextField \"field name\")))\n",
    "f1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f1 get \"field name\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f1 put \"field name\" \"1text from code1\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form2\")\n",
    "        (.addTextField \"field name\" (Integer. 10)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f3 (doto (EasyForm. \"form3\")\n",
    "        (.addTextArea \"field name\")))\n",
    "f3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f3 get \"field name\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f3 put \"field name\" \"3text from code3\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form4\")\n",
    "        (.addTextArea \"field name\" (Integer. 20) (Integer. 5)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form5\")\n",
    "        (.addTextArea \"field name\" \"5initial value5\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f6 (doto (EasyForm. \"form6\")\n",
    "        (.addCheckBox \"field name\")))\n",
    "f6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f6 get \"field name\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f6 put \"field name\" \"false\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form7\")\n",
    "        (.addCheckBox \"field name\" true))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f8 (doto (EasyForm. \"form8\")\n",
    "        (.addComboBox \"field name\" [\"one\", \"two\", \"three\"])))\n",
    "f8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f8 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f8 put \"field name\" \"three\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f9 (doto (EasyForm. \"form9\")\n",
    "        (.addList \"field name\" [\"one\", \"two\", \"three\"])))\n",
    "f9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f9 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f9 put \"field name\" [\"one\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f10 (doto (EasyForm. \"form10\")\n",
    "        (.addList \"field name\" [\"one\", \"two\", \"three\"] false)))\n",
    "f10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f10 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form11\")\n",
    "        (.addList \"field name\" [\"one\", \"two\", \"three\", \"four\"] (Integer. 2)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f12 (doto (EasyForm. \"form12\")\n",
    "        (.addCheckBoxes \"field name\" [\"one\", \"two\", \"three\", \"four\"])))\n",
    "f12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f12 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f12 put \"field name\" [\"one\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form13\")\n",
    "        (.addCheckBoxes \"field name\" [\"one\", \"two\", \"three\"] EasyForm/HORIZONTAL))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f14 (doto (EasyForm. \"form14\")\n",
    "        (.addRadioButtons \"field name\" [\"one\", \"two\", \"three\"])))\n",
    "f14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f14 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f14 put \"field name\" \"three\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(doto (EasyForm. \"form15\")\n",
    "        (.addRadioButtons \"field name\" [\"one\", \"two\", \"three\"] EasyForm/HORIZONTAL))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(def f16 (doto (EasyForm. \"form16\")\n",
    "        (.addDatePicker \"field name\")))\n",
    "f16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f16 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f16 put \"field name\" \"20170527\")\n",
    "(. f16 get \"field name\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(import '[com.twosigma.beakerx.easyform.formitem EasyFormListener])\n",
    "(def f17 (doto (EasyForm. \"form17\")\n",
    "        (.addButton \"run tag\" \"tag1\")))\n",
    "(def f18 (doto (EasyForm. \"form18\")))\n",
    "(def button18 (. f17 addButton \"actionPerformed\"))\n",
    "(set! (. button18 actionPerformed) \n",
    "            (reify EasyFormListener (execute [this value]\n",
    "                  (. f18 put \"field4\" \"from actionPerformed\")))\n",
    ")\n",
    "f17"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f18 put \"field2\" \"test text\")\n",
    "(. f18 get \"field2\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "tags": [
     "tag1"
    ]
   },
   "outputs": [],
   "source": [
    "(def f18 (doto (EasyForm. \"form18\")\n",
    "        (.. (addTextField \"field1\") \n",
    "            (onInit (reify EasyFormListener (execute [this value]\n",
    "                  (. f18 put \"field1\" \"from onInit\")))))\n",
    "        (.. (addTextField \"field2\") \n",
    "            (onChange (reify EasyFormListener (execute [this text]\n",
    "                  (. f18 put \"field3\" (str text \" from onChange\"))))))\n",
    "        (.addTextField \"field3\")\n",
    "        (.addTextField \"field4\")))\n",
    "f18"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(import '[com.twosigma.beakerx.widget IntSlider])\n",
    "(def f19 (doto (EasyForm. \"form19\")\n",
    "        (.addWidget \"slider19\" (doto (IntSlider.)(.setValue \"50\")))\n",
    "        ))\n",
    "f19"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(. f19 get \"slider19\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Clojure",
   "language": "clojure",
   "name": "clojure"
  },
  "language_info": {
   "codemirror_mode": "Clojure",
   "file_extension": ".clj",
   "mimetype": "text/x-clojure",
   "name": "Clojure",
   "nbconverter_exporter": "",
   "version": "1.9.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": false,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": false,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
